package com.zheng.upms.dao.model;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.zheng.common.base.BaseEntity;

import java.io.Serializable;

/**
 * <p>
 * 角色
 * </p>
 *
 * @author likun
 * @since 2017-12-29
 */
@TableName("upms_role")
public class UpmsRole extends BaseEntity<UpmsRole> {

    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
	@TableId(value="role_id", type= IdType.AUTO)
	private Integer roleId;
    /**
     * 角色名称
     */
	private String name;
    /**
     * 角色标题
     */
	private String title;
	/**
	 * 数据权限
	 */
	@TableField("data_scope")
	private Integer dataScope;
    /**
     * 角色描述
     */
	private String description;
    /**
     * 排序
     */
	private Long orders;

	// 数据范围（0：按明细设置;1：所有数据；3：所在部门及以下数据；5：所在部门数据；7：仅本人数据；）
	public static final Integer DATA_SCOPE_CUSTOM = 0;
	public static final Integer DATA_SCOPE_ALL = 1;
	public static final Integer DATA_SCOPE_OFFICE_AND_CHILD = 3;
	public static final Integer DATA_SCOPE_OFFICE = 5;
	public static final Integer DATA_SCOPE_SELF = 7;


	public Integer getRoleId() {
		return roleId;
	}

	public void setRoleId(Integer roleId) {
		this.roleId = roleId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Integer getDataScope() {
		return dataScope;
	}

	public void setDataScope(Integer dataScope) {
		this.dataScope = dataScope;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Long getOrders() {
		return orders;
	}

	public void setOrders(Long orders) {
		this.orders = orders;
	}

	@Override
	protected Serializable pkVal() {
		return this.roleId;
	}

	@Override
	public String toString() {
		return "UpmsRole{" +
			"roleId=" + roleId +
			", name=" + name +
			", title=" + title +
			", dataScope=" + dataScope +
			", description=" + description +
			", ctime=" + ctime +
			", orders=" + orders +
			"}";
	}
}
